#!/bin/bash
DBPass=redhat
/usr/bin/expect << EOF
set timeout 30
spawn mysql_secure_installation
expect {
 "enter for none" { send "\r"; exp_continue}
 "Y/n" { send "Y\r" ; exp_continue}
 "password:" { send "$DBPass\r"; exp_continue}
 "new password:" { send "$DBPass\r";
exp_continue}
 "Y/n" { send "Y\r" ; exp_continue}
 eof { exit }
}
EOF
mysql -uroot -predhat
GRANT ALL PRIVILEGES ON *.* TO 'root'@'%'
IDENTIFIED BY 'redhat' ;
MariaDB [(none)]> create database along;
exit


